#ifndef     __PICK_MOTOR_H
#define     __PICK_MOTOR_H

#include "../utils/nocopyable.h"
#include "../utils/object.h"
#include "../utils/error.h"

namespace cargo_driver {

class PickMotor {

public:
    void init();

    Error async_run_with_col(uint8_t col, uint16_t offset) {
        return async_run_with_mm(((col - 1) * 80) + offset);
    }

    Error wait_for();

    bool is_alm() const;

private:
    Error async_run_with_mm(uint16_t mm) {
        return async_run(mm * 400 / (22 * 3));
    }
    Error async_run(uint32_t position);
};

extern PickMotor pickMotor;


}

#endif
